<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>

<%
    request.setCharacterEncoding("UTF-8");
    String htmlData = request.getParameter("content1") != null ? request.getParameter("content1") : "";
%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ include file="/WEB-INF/JSP/backHome/modalWindows/StudentsListDropexerciseTwo.jsp" %>
<%@ include file="/WEB-INF/JSP/backHome/modalWindows/CartimeListPage.jsp" %>
<%@ include file="/WEB-INF/JSP/backHome/modalWindows/argeeCommon.jsp" %>
<%@ include file="/WEB-INF/JSP/backHome/modalWindows/againstAuditCommon.jsp" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Insert title here</title>
    <script type="text/javascript" src="<%=path%>/My97DatePicker/WdatePicker.js"></script>
    <link rel="stylesheet" type="text/css" href="<%=path%>/CSS/backLayout.css">
    <link rel="stylesheet" type="text/css" href="<%=path%>/CSS/bombBox.css">
</head>
<style>
    select {
        width: 234px;
        height: 31px
    }

    .tr{
        background-color: #57a0ff;
        font-weight:700;
    }
    .tr td {
        font-size: 14px;
        color: #ffffff
    }

    .tr_td {
        height: 40px;
    }

    .tr_td td {
        border-bottom: 1px solid #ededed;
        text-align: center;
    }

    tr td:nth-child(1) {
        font-size: 14px;
        color: #cccccc
    }

    .date {
        border: 0;
        background: #ffffff;
        text-align: center;
    }

    .tr_td td:nth-child(1) {
        border-left: 1px solid #cccccc;
    }

    .tr_td td:nth-child(3) {
        border-right: 1px solid #cccccc;
    }

    .addTable.deleteTable:HOVER {
        cursor: pointer;
    }

    type[type='checkbox'] {
        width: 15px;
    }
    .botton input {
        width: 230px;
    }

    .div_body {
        min-height: 900px;
    }

    .div_zilei {
        height: 30px
    }

</style>
<body style="background: #f5f5f5">
<div class="main">
    <div id="modal-overlay">

    </div>
    <div class="weizhi">
        <c:if test="${dropexercisethreeList.cfbillstate == 3}">
            练车管理>>科目三退练>>修改
        </c:if>
        <c:if test="${dropexercisethreeList.cfbillstate != 3}">
            练车管理>>科目三退练>>查看
        </c:if>
    </div>
    <div class="div_body" style="box-shadow: 0 0 5px #cccccc; min-hight:900px;">
        <%--未审核--%>
        <c:if test="${dropexercisethreeList.cfbillstate == 3}">
            <div class="div_form">
                <form id="update_shar" action="<%=path%>/DrivingSys/update_dropexercisethree" onsubmit="StopRepeat()"
                      class="form"
                      method="post">
                    <div class="div_input_hang">
                        <input type="hidden" name="fid" id="fid" value="${dropexercisethreeList.fid}"/>
                        <div class="input_hang">
                            <span class="gn_name">驾校&nbsp;:&nbsp;</span>
                            <input type="text" name="name" value="${department}" readonly="readonly"
                                   style="color: gray;"/>
                        </div>
                        <div class="input_hang">
                            <span class="gn_name">单据编号&nbsp;:&nbsp;</span>
                            <input type="text" name="fnumber" id="fnumber" value="${dropexercisethreeList.fnumber}"
                                   style="color: gray;"
                                   readonly="readonly"/>
                        </div>
                        <div class="input_hang">
                            <span class="gn_name">业务日期&nbsp;:&nbsp;</span>
                            <input type="text" name="fbizdate" id="fbizdate_bind"
                                   value="${dropexercisethreeList.fbizdate}"
                                   onclick="WdatePicker({el:'fbizdate_bind',dateFmt:'yyyy-MM-dd'})"/>
                            <img onclick="WdatePicker({el:'fbizdate_bind',dateFmt:'yyyy-MM-dd'})"
                                 src="<%=path%>/image/date.jpg" align="absmiddle" style="padding-left: 15px">
                        </div>
                    </div>
                    <div class="div_input_hang">
                        <div class="input_hang">
                            <span class="gn_name">参考信息&nbsp;:&nbsp;</span>
                            <input name="fdescription" value="${dropexercisethreeList.fdescription}"/>
                        </div>
                        <div class="input_hang">
                            <span class="gn_name">单据状态&nbsp;:&nbsp;</span>
                            <select name="cfbillstate">
                                <option id="fdescriptionL2" style="color: gray;" value="3">新增</option>
                            </select>
                        </div>
                        <div class="input_hang">
                            <span class="gn_name">练车时间&nbsp;:&nbsp;</span>
                            <input name="cflcsj" value="${dropexercisethreeList.cflcsjName}" style="color: gray;"
                                   class="is_click"
                                   onclick="clicklcsj($(this))"/>
                            <input class="cflcsjid" type="hidden" name="cflcsjid"
                                   value="${dropexercisethreeList.cflcsjid}"
                                   style="color: gray;"/>
                        </div>
                    </div>
                    <div style="width: 20%; margin-left: 90px; float: left">已退学员</div>
                    <div class="div_zilei" style="margin-left: 90px; float: left">
                        <div style="width: 40%;text-align: right;">
                            <img src="<%=path%>/image/insert2323.jpg" class="addTable">
                            <span style="padding-right: 20px;color:#57a0ff;font-weight:700;font-size: 14px" class="addTable">添加</span>
                            <img src="<%=path%>/image/delete212.png" class="deleteTable">
                            <span class="deleteTable" style="color:#57a0ff;font-weight:700;font-size: 14px"
                                  class="deleteTable">删除</span>
                        </div>
                    </div>
                    <div style="overflow:auto;min-height: 390px;max-height: 390px;width: 88%;margin-left: 90px;">
                        <table id="tablejl" width="55%" style=" min-height:50px;border-spacing:0;white-space:nowrap;">
                            <tr class="tr">
                                <td align="right"><%--<input type="checkbox" name="check" class="check"
                                                         style="width: 15px;">--%></td>
                                <td width="30px">序号</td>
                                <td align="center">学员</td>
                                <td align="center">学员编号</td>
                                <td align="center">身份证号码</td>
                                <td align="center">教练</td>
                                <td align="center">几人一车</td>
                                <td align="center">练车天数</td>
                                <td align="center">退练原因</td>
                            </tr>
                            <c:forEach items="${dropexercisethreeList.dropexercisethreeentryList}" var="dropexercis"
                                       varStatus="s">
                                <tr>
                                    <td width='20px' align='center'><input class='check2' type='checkbox' name='check2'
                                                                           style='width:15px'></td>
                                    <td><input type="text" class="fseq" name="fseq" value="${s.index+1}"
                                               readonly="readonly"></td>
                                    <td name='notcheck' align='center'><input style='width: 70px;' type='text'
                                                                              name='cfstudentName' class="is_click"
                                                                              value='${dropexercis.cfstudentName}'
                                                                              onclick='clickName($(this))'/> <input
                                            type="hidden"
                                            name="cfstudentid" class="cfstudentid"
                                            value="${dropexercis.cfstudentid}"/><%--学员id--%>
                                    </td>
                                    <td align='center'><input style='width: 120px;'
                                                              type='text' name='cfstudentno' readonly="readonly"
                                                              value='${dropexercis.cfstuno}'/>
                                    </td>
                                    <td align='center'><input style='width: 140px;' type='text' name='cfidcardno'
                                                              readonly="readonly"
                                                              value='${dropexercis.cfstucardno}'/>
                                    </td>
                                    <td align='center'><input style='width: 70px;' type='text' readonly="readonly"
                                                              name='cfcoachName' value='${dropexercis.cfcoachName}'/>
                                        <input type="hidden" name="cfcoachid" value="${dropexercis.cfcoachid}"/><%--教练id--%>
                                    </td>
                                    <td name='notcheck' align='center'><input style='width: 70px;' type='text'
                                                                              name='cfcarpeoplenum'
                                                                              class="cfcarpeoplenum"
                                                                              value='${dropexercis.cfcarpeoplenum}'/>
                                    </td>
                                    <td name='notcheck' align='center'><input style='width: 70px;' type='text'
                                                                              name='cflcts' class="cflcts"
                                                                              value='${dropexercis.cflcts}'/></td>

                                    <td name='notcheck' align='center'><input style='width: 150px;' type='text'
                                                                              name='cftlyy' class="cftlyy"
                                                                              value='${dropexercis.cftlyy}'/></td>
                                </tr>
                            </c:forEach>
                        </table>
                    </div>
                    <div style="line-height:31px; margin-top: 80px; height: 31px; ">
                        <div class="botton">
                            <span class="gn_name">审核人&nbsp;:&nbsp;</span>
                            <input id="shename" readonly="readonly" type="text" name="ffivouchered"
                                   value="${dropexercisethreeList.checkName}">
                        </div>
                        <div class="botton">
                            <span class="gn_name">创建人&nbsp;:&nbsp;</span>
                            <input id="createname" readonly="readonly" type="text" name="createName"
                                   value="${dropexercisethreeList.createName}">
                        </div>
                        <div class="botton">
                            <span class="gn_name">创建时间&nbsp;:&nbsp;</span>
                            <input id="updatetime" readonly="readonly" type="text" name="fcreatetime"
                                   value="${dropexercisethreeList.fcreatetime}">
                        </div>
                    </div>

                    <div class="div_tj">
                        <shiro:hasPermission name="/update_dropexercisethree">
                            <div>
                                <input type="button" class="input_submit bc" onclick="audit(2)" value="">
                            </div>
                        </shiro:hasPermission>
                        <shiro:hasPermission name="/submitDropexerciseThree">
                            <div>
                                <input type="button" class="input_submit tj" value="" onclick="submitTj()"/>
                            </div>
                        </shiro:hasPermission>
                        <div>
                            <input type="button" class="input_submit cklc" value=""
                                   onclick="lookActivitiImg('publicProcess',$('#fnumber').val())">
                        </div>
                        <div>
                            <input type="button" class="input_back fh" value=""
                                   onclick="back()"/>
                        </div>
                    </div>
                </form>
            </div>
        </c:if>
            <%--提交--%>
            <c:if test="${dropexercisethreeList.cfbillstate == 4}">
            <div class="div_form">
                <form id="update_shar" action="<%=path%>/DrivingSys/update_dropexercisethree" class="form"
                      method="post">
                    <div class="div_input_hang">
                        <input type="hidden" name="fid" id="fid" value="${dropexercisethreeList.fid}"/>
                        <div class="input_hang">
                            <span class="gn_name">驾校&nbsp;:&nbsp;</span>
                            <input type="text" name="name" value="${department}" readonly="readonly"
                                   style="color: gray;"/>
                        </div>
                        <div class="input_hang">
                            <span class="gn_name">单据编号&nbsp;:&nbsp;</span>
                            <input type="text" name="fnumber" id="fnumber" value="${dropexercisethreeList.fnumber}"
                                   style="color: gray;"
                                   readonly="readonly"/>
                        </div>
                        <div class="input_hang">
                            <span class="gn_name">业务日期&nbsp;:&nbsp;</span>
                            <input type="text" name="fbizdate" id="fbizdate_bind"
                                   value="${dropexercisethreeList.fbizdate}"
                                   readonly="readonly"/>
                            <img
                                    src="<%=path%>/image/date.jpg" align="absmiddle" style="padding-left: 15px">
                        </div>
                    </div>
                    <div class="div_input_hang">
                        <div class="input_hang">
                            <span class="gn_name">参考信息&nbsp;:&nbsp;</span>
                            <input name="fdescription" value="${dropexercisethreeList.fdescription} "
                                   readonly="readonly"/>
                        </div>
                        <div class="input_hang">
                            <span class="gn_name">单据状态&nbsp;:&nbsp;</span>
                            <select name="cfbillstate">
                                <option id="fdescriptionL2" style="color: gray;" value="4">提交</option>
                            </select>
                        </div>
                        <div class="input_hang">
                            <span class="gn_name">练车时间&nbsp;:&nbsp;</span>
                            <input name="cflcsj" value="${dropexercisethreeList.cflcsjName}" style="color: gray;"
                                   class="is_click"
                                   readonly="readonly"/>
                            <input class="cflcsjid" type="hidden" name="cflcsjid"
                                   value="${dropexercisethreeList.cflcsjid}"
                                   style="color: gray;"/>
                        </div>
                    </div>
                    <div style="width: 20%; margin-left: 90px; float: left">已退学员</div>
                    <div class="div_zilei" style="margin-left: 90px; float: left">

                    </div>
                    <div style="overflow:auto;min-height: 390px;max-height: 390px;width: 88%;margin-left: 90px;">
                        <table id="tablejl" width="55%" style=" min-height:50px;border-spacing:0;white-space:nowrap;">
                            <tr class="tr">
                                <td align="right"><%--<input type="checkbox" name="check" class="check"
                                                         style="width: 15px;">--%></td>
                                <td width="30px">序号</td>
                                <td align="center">学员</td>
                                <td align="center">学员编号</td>
                                <td align="center">身份证号码</td>
                                <td align="center">教练</td>
                                <td align="center">几人一车</td>
                                <td align="center">练车天数</td>
                                <td align="center">退练原因</td>
                            </tr>
                            <c:forEach items="${dropexercisethreeList.dropexercisethreeentryList}" var="dropexercis"
                                       varStatus="s">
                                <tr>
                                    <td width='20px' align='center'><input class='check2' type='checkbox' name='check2'
                                                                           style='width:15px'></td>
                                    <td><input type="text" class="fseq" name="fseq" value="${s.index+1}"
                                               readonly="readonly"></td>

                                    <td name='notcheck' align='center'><input style='width: 70px;' type='text'
                                                                              name='cfstudentName' class="is_click"
                                                                              value='${dropexercis.cfstudentName}'
                                                                              readonly="readonly"/> <input
                                            type="hidden"
                                            name="cfstudentid" class="cfstudentid"
                                            value="${dropexercis.cfstudentid}"/><%--学员id--%>
                                    </td>
                                    <td align='center'><input style='width: 120px;'
                                                              type='text' name='cfstudentno' readonly="readonly"
                                                              value='${dropexercis.cfstuno}'/>
                                    </td>
                                    <td align='center'><input style='width: 140px;' type='text' name='cfidcardno'
                                                              readonly="readonly"
                                                              value='${dropexercis.cfstucardno}'/>
                                    </td>
                                    <td align='center'><input style='width: 70px;' type='text' readonly="readonly"
                                                              name='cfcoachName' value='${dropexercis.cfcoachName}'/>
                                        <input type="hidden" name="cfcoachid" value="${dropexercis.cfcoachid}"/><%--教练id--%>
                                    </td>
                                    <td name='notcheck' align='center'><input style='width: 70px;' type='text'
                                                                              name='cfcarpeoplenum' readonly="readonly"
                                                                              class="cfcarpeoplenum"
                                                                              value='${dropexercis.cfcarpeoplenum}'/>
                                    </td>
                                    <td name='notcheck' align='center'><input style='width: 70px;' type='text'
                                                                              class="cflcts"
                                                                              name='cflcts' readonly="readonly"
                                                                              value='${dropexercis.cflcts}'/></td>

                                    <td name='notcheck' align='center'><input style='width: 150px;' type='text'
                                                                              name='cftlyy' readonly="readonly"
                                                                              class="cftlyy"
                                                                              value='${dropexercis.cftlyy}'/></td>
                                </tr>
                            </c:forEach>
                        </table>
                    </div>
                    <div style="line-height:31px; margin-top: 80px; height: 31px; ">
                        <div class="botton">
                            <span class="gn_name">审核人&nbsp;:&nbsp;</span>
                            <input id="shename" readonly="readonly" type="text" name="ffivouchered"
                                   value="${dropexercisethreeList.checkName}">
                        </div>
                        <div class="botton">
                            <span class="gn_name">创建人&nbsp;:&nbsp;</span>
                            <input id="createname" readonly="readonly" type="text" name="createName"
                                   value="${dropexercisethreeList.createName}">
                        </div>
                        <div class="botton">
                            <span class="gn_name">创建时间&nbsp;:&nbsp;</span>
                            <input id="updatetime" readonly="readonly" type="text" name="fcreatetime"
                                   value="${dropexercisethreeList.fcreatetime}">
                        </div>
                    </div>

                    <div class="div_tj">
                        <c:if test="${AuditState == 'true'}">
                            <shiro:hasPermission name="/auditDropexerciseThree">
                                <div>
                                    <input type="button" class="input_submit sh" value="" onclick="examine(5)"/>
                                </div>
                            </shiro:hasPermission>
                        </c:if>
                        <shiro:hasPermission name="/againstAuditDropexerciseThree">
                            <div>
                                <input type="button" class="input_submit fsh" onclick="examine(3)" value="">
                            </div>
                        </shiro:hasPermission>
                        <div>
                            <input type="button" class="input_submit cklc" value=""
                                   onclick="lookActivitiImg('publicProcess',$('#fnumber').val())">
                        </div>
                        <div>
                            <input type="button" class="input_back fh" value=""
                                   onclick="back()"/>
                        </div>
                    </div>
                </form>
            </div>
            </c:if>
            <%--审核--%>
            <c:if test="${dropexercisethreeList.cfbillstate == 5}">
                <div class="div_form">
                    <form id="update_shar" action="<%=path%>/DrivingSys/update_dropexercisethree" class="form"
                          method="post">
                        <div class="div_input_hang">
                            <input type="hidden" name="fid" id="fid" value="${dropexercisethreeList.fid}"/>
                            <div class="input_hang">
                                <span class="gn_name">驾校&nbsp;:&nbsp;</span>
                                <input type="text" name="name" value="${department}" readonly="readonly"
                                       style="color: gray;"/>
                            </div>
                            <div class="input_hang">
                                <span class="gn_name">单据编号&nbsp;:&nbsp;</span>
                                <input type="text" name="fnumber" id="fnumber" value="${dropexercisethreeList.fnumber}"
                                       style="color: gray;"
                                       readonly="readonly"/>
                            </div>
                            <div class="input_hang">
                                <span class="gn_name">业务日期&nbsp;:&nbsp;</span>
                                <input type="text" name="fbizdate" id="fbizdate_bind"
                                       value="${dropexercisethreeList.fbizdate}"
                                       readonly="readonly"/>
                                <img
                                        src="<%=path%>/image/date.jpg" align="absmiddle" style="padding-left: 15px">
                            </div>
                        </div>
                        <div class="div_input_hang">
                            <div class="input_hang">
                                <span class="gn_name">参考信息&nbsp;:&nbsp;</span>
                                <input name="fdescription" readonly="readonly"
                                       value="${dropexercisethreeList.fdescription}"/>
                            </div>
                            <div class="input_hang">
                                <span class="gn_name">单据状态&nbsp;:&nbsp;</span>
                                <select name="cfbillstate">
                                    <option id="fdescriptionL2" style="color: gray;" value="5">审核</option>
                                </select>
                            </div>
                            <div class="input_hang">
                                <span class="gn_name">练车时间&nbsp;:&nbsp;</span>
                                <input name="cflcsj" value="${dropexercisethreeList.cflcsjName}" style="color: gray;"
                                       class="is_click"
                                       readonly="readonly"/>
                                <input class="cflcsjid" type="hidden" name="cflcsjid"
                                       value="${dropexercisethreeList.cflcsjid}"
                                       style="color: gray;"/>
                            </div>
                        </div>
                        <div style="width: 20%; margin-left: 90px; float: left">已退学员</div>
                        <div class="div_zilei" style="margin-left: 90px; float: left">

                        </div>
                        <div style="overflow:auto;min-height: 390px;max-height: 390px;width: 88%;margin-left: 90px;">
                            <table id="tablejl" width="55%"
                                   style=" min-height:50px;border-spacing:0;white-space:nowrap;">
                                <tr class="tr">
                                    <td align="right"><%--input type="checkbox" name="check" class="check"
                                                             style="width: 15px;">--%></td>
                                    <td width="30px">序号</td>
                                    <td align="center">学员</td>
                                    <td align="center">学员编号</td>
                                    <td align="center">身份证号码</td>
                                    <td align="center">教练</td>
                                    <td align="center">几人一车</td>
                                    <td align="center">练车天数</td>
                                    <td align="center">退练原因</td>
                                </tr>
                                <c:forEach items="${dropexercisethreeList.dropexercisethreeentryList}" var="dropexercis"
                                           varStatus="s">
                                    <tr>
                                        <td width='20px' align='center'><input class='check2' type='checkbox'
                                                                               name='check2'
                                                                               style='width:15px'></td>
                                        <td><input type="text" class="fseq" name="fseq" value="${s.index+1}"
                                                   readonly="readonly"></td>

                                        <td name='notcheck' align='center'><input style='width: 70px;' type='text'
                                                                                  name='cfstudentName' class="is_click"
                                                                                  value='${dropexercis.cfstudentName}'
                                                                                  readonly="readonly"/> <input
                                                type="hidden"
                                                name="cfstudentid" class="cfstudentid"
                                                value="${dropexercis.cfstudentid}"/><%--学员id--%>
                                        </td>
                                        <td align='center'><input style='width: 120px;'
                                                                  type='text' name='cfstudentno' readonly="readonly"
                                                                  value='${dropexercis.cfstuno}'/>
                                        </td>
                                        <td align='center'><input style='width: 140px;' type='text' name='cfidcardno'
                                                                  readonly="readonly"
                                                                  value='${dropexercis.cfstucardno}'/>
                                        </td>
                                        <td align='center'><input style='width: 70px;' type='text' readonly="readonly"
                                                                  name='cfcoachName'
                                                                  value='${dropexercis.cfcoachName}'/>
                                            <input type="hidden" name="cfcoachid" value="${dropexercis.cfcoachid}"/><%--教练id--%>
                                        </td>
                                        <td name='notcheck' align='center'><input style='width: 70px;' type='text'
                                                                                  name='cfcarpeoplenum'
                                                                                  readonly="readonly"
                                                                                  class="cfcarpeoplenum"
                                                                                  value='${dropexercis.cfcarpeoplenum}'/>
                                        </td>
                                        <td name='notcheck' align='center'><input style='width: 70px;' type='text'
                                                                                  class="cflcts"
                                                                                  name='cflcts' readonly="readonly"
                                                                                  value='${dropexercis.cflcts}'/></td>

                                        <td name='notcheck' align='center'><input style='width: 150px;' type='text'
                                                                                  class="cftlyy"
                                                                                  name='cftlyy' readonly="readonly"
                                                                                  value='${dropexercis.cftlyy}'/></td>
                                    </tr>
                                </c:forEach>
                            </table>
                        </div>
                        <div style="line-height:31px; margin-top: 80px; height: 31px; ">
                            <div class="botton">
                                <span class="gn_name">审核人&nbsp;:&nbsp;</span>
                                <input id="shename" readonly="readonly" type="text" name="ffivouchered"
                                       value="${dropexercisethreeList.checkName}">
                            </div>
                            <div class="botton">
                                <span class="gn_name">创建人&nbsp;:&nbsp;</span>
                                <input id="createname" readonly="readonly" type="text" name="createName"
                                       value="${dropexercisethreeList.createName}">
                            </div>
                            <div class="botton">
                                <span class="gn_name">创建时间&nbsp;:&nbsp;</span>
                                <input id="updatetime" readonly="readonly" type="text" name="fcreatetime"
                                       value="${dropexercisethreeList.fcreatetime}">
                            </div>
                        </div>

                        <div class="div_tj">
                            <shiro:hasPermission name="/againstAuditDropexerciseThree">
                                <div>
                                    <input type="button" class="input_submit fsh" onclick="examine(3)" value="">
                                </div>
                            </shiro:hasPermission>
                            <div>
                                <input type="button" class="input_submit cklc" value=""
                                       onclick="lookActivitiImg('publicProcess',$('#fnumber').val())">
                            </div>
                        <div>
                            <input type="button" class="input_back fh" value=""
                                   onclick="back()"/>
                        </div>
                    </div>
                </form>
            </div>
        </c:if>

    </div>
</div>
</body>
<script type="text/javascript" src="<%=path%>/JQuery/jquery-1.8.2.js"></script>
<script type="text/javascript" src="<%=path%>/HoganJS/handlebars-v4.0.11.js"></script>
<script type="text/javascript">


    //选中的删除
    $(".deleteTable").click(function () {
        var tr_len = $("#tablejl tr").length;
            var s = '';
            $('input:checkbox[name=check2]').each(function (i) {

                if ($(this).is('.check2:checked')) {

                    $(this).parent().parent().remove();
                    s = '1';
                    reorder()
                }
            })

            //判断是否选中
            if (s == null || s == '') {
                alert("请选择一条数据删除");
                return false;
            }
    })
    //设置全选功选
    $('.check').click(function () {
        if ($(this).attr("checked")) {
            $(".check2:checkbox").prop("checked", true)
        } else {
            $('.check2:checkbox').removeAttr('checked')
        }
    })
    //由于和input:checkbox冲突，在选择一次
    $("#tablejl tr td .check2:checkbox").live('click', function () {
        if ($(this).is('.check2:checked')) {
            $(this).removeAttr("checked");
        } else {
            $(this).attr("checked", ".check2:checked")
        }
    })
    //单击选中
    $("#tablejl tr td").live('click', function () {
        if ($(this).parent().find(".check2:checkbox").is(':checked')) {
            $(this).parent().find(".check2:checkbox").removeAttr("checked");
        } else {
            $(this).parent().find(".check2:checkbox").attr("checked", ":checked")
        }
    })

    function submitTj() {

        $.messager.confirm('提示', '是否提交,提交后不会改变修改后的值', function (r) {

            if (r) {
                $.ajax({
                    url: '<%=path%>/DrivingSys/queryDropexercisethreeSubmit',
                    type: "post",
                    data: {
                        'fid': $('#fid').val(),
                        'fnumber': $('#fnumber').val()
                    },
                    dataType: "json",
                    success: function (res) {
                        showAlert(res.msg, 'queryDropexercisethree/look.action?state=first');
                    },
                    error: function () {
                        alert('错误');
                    }
                })
            }
        });

    }

    $('#auditsubmit').click(function () {

        var studentid = new Array();
        var cftlyy = new Array();

        $('.cfstudentid').each(function (i) {
            studentid[i] = $(this).val();
        })
        $('.cftlyy').each(function (i) {
            cftlyy[i] = $(this).val();
        })

        $('.auditcheck').each(function () {
            if ($(this).is(':checked')) {
                $.ajax({
                    url: '<%=path%>/DrivingSys/queryDropexercisethreeExamine',
                    type: "post",
                    data: {
                        'fid': $('#fid').val(),
                        'state': _state,
                        'fnumber': $('#fnumber').val(),
                        'agreed': $(this).val(),
                        'auditcomment': $('#auditcomment').val(),
                        'studentid': studentid,
                        'cftlyy': cftlyy,
                        'cflcsjid': $('.cflcsjid').val()
                    },
                    dataType: "json",
                    success: function (res) {
                        showAlert(res.msg, 'queryDropexercisethree/look.action?state=first');
                    },
                    error: function () {
                        alert('错误');
                    }
                })
            } else {

            }
        })
    })
    //反审核按钮
    $('#againstAuditsubmit').click(function () {
        $.ajax({
            url: '<%=path%>/DrivingSys/queryDropexercisethreeExamine',
            type: "post",
            data: {
                'fid': $('#fid').val(),
                'state': _state,
                'fnumber': $('#fnumber').val(),
                'auditcomment': $('#againstAuditcomment').val()
            },
            dataType: "json",
            success: function (res) {
                showAlert(res.msg, 'queryDropexercisethree/look.action?state=first');
            },
            error: function () {
                alert('错误');
            }
        })
    })

    function examine(state) {
        _state = state;
        if (state == 5) {
            $('#modal-overlay').css('visibility', 'visible')
            $('.modal-data9').css('visibility', 'visible')
        }
        else if (state == 3) {
            $('#modal-overlay').css('visibility', 'visible')
            $('.modal-data10').css('visibility', 'visible')
        }
    }

    //改变审核状态
    function audit(state) {
        //改变单据状态
        $("#fdescriptionL2").val(state);
        //写入审核人标记
        $("#shename").val(state);
        chcek();
        if ($('#update_shar').find("tr").length == 1) {
            alert('请至少选择一条数据！')
            return false;
        }
        $('#update_shar').submit()
    }

    $('.addTable').click(function () {
        fseq = CalculateMaxNum('tablejl')
        var htmlperson = "<tr><td width='20px' align='center' ><input class='check2' type='checkbox' name='check2' style='width:15px'></td>" +
            " <td><input type='text' class='fseq' name='fseq' value='" + fseq + "' readonly='readonly'></td>" +
            "<td name='notcheck' align='center'><input style='width: 70px;' type='text' name='cfstudentName' class='is_click' value='' onclick='clickName($(this))'/>" +
            "<input type='hidden' class='cfstudentid' name='cfstudentid'/></td> " +
            "<td align='center'><input style='width: 120px;'type='text' readonly='readonly' name='cfstudentno' value=''/></td> " +
            "<td align='center'><input style='width: 140px;' type='text' readonly='readonly' name='cfidcardno' value=''/> </td> " +
            "<td align='center'><input style='width: 70px;' type='text' readonly='readonly' name='cfcoachName' value=''/> " +
            "<input type='hidden' name='cfcoachid'/></td>" +
            " <td name='notcheck' align='center'><input style='width: 70px;' type='text'name='cfcarpeoplenum' class='cfcarpeoplenum' value='0'/> </td>" +
            " <td name='notcheck' align='center'><input style='width: 70px;' type='text'name='cflcts' class='cflcts' value='0'/></td>" +
            " <td name='notcheck' align='center'><input style='width: 150px;' type='text'name='cftlyy' class='cftlyy' value=''/></td>" +
            " </tr>";
        $("#tablejl").append(htmlperson)
    })

    function addStu() {
        fseq = CalculateMaxNum('tablejl')
        var htmlperson = "<tr>" +
            "<td align='right' width='20px'><input class='check2' type='checkbox' name='check2' style='width:15px'></td>" +
            " <td><input type='text' class='fseq' name='fseq' value='" + fseq + "' readonly='readonly'></td>" +
            "<td name='notcheck' align='center'><input style='width: 70px;' type='text' class='is_click' name='cfstudentName' value='' onclick='clickName($(this))'/>" +
            "<input type='hidden' class='cfstudentid' name='cfstudentid'/></td> " +
            "<td align='center'><input style='width: 120px;'type='text' readonly='readonly' name='cfstudentno' value=''/></td> " +
            "<td align='center'><input style='width: 140px;' type='text' readonly='readonly' name='cfidcardno' value=''/> </td> " +
            "<td align='center'><input style='width: 70px;' type='text' readonly='readonly' name='cfcoachName' value=''/> " +
            "<input type='hidden' name='cfcoachid'/></td>" +
            " <td name='notcheck' align='center'><input style='width: 70px;' type='text'name='cfcarpeoplenum' class='cfcarpeoplenum' value='0'/> </td>" +
            " <td name='notcheck' align='center'><input style='width: 70px;' type='text'name='cflcts' class='cflcts' value='0'/></td>" +
            " <td name='notcheck' align='center'><input style='width: 150px;' type='text'name='cftlyy' value=''/></td>" +
            " </tr>";
        $("#tablejl").append(htmlperson)
    }

    //改变复选框的值
    function chcek() {
        $(".cfduizhang2").each(function () {
            if ($(this).is(':checked')) {
                $(this).next().val(0);
            } else {
                $(this).next().val(1);
            }
        });
        $(".cfstuvip2").each(function () {
            if ($(this).is(':checked')) {
                $(this).next().val(0);
            } else {
                $(this).next().val(1);
            }
        });

    }

    /* 关闭弹出框    */
    $('.btn').click(function () {
        $('#modal-overlay').css('visibility', 'hidden')
        $('.modal-data').css('visibility', 'hidden')
        $('.modal-data1').css('visibility', 'hidden')
        $('.modal-data2').css('visibility', 'hidden')
        $('.modal-data3').css('visibility', 'hidden')
        $('.modal-data9').css('visibility', 'hidden')
        $('.modal-data10').css('visibility', 'hidden')
        $('.data-checkbox:checkbox').removeAttr('checked');
        $('.data1-checkbox:checkbox').removeAttr('checked');
        $('.data2-checkbox:checkbox').removeAttr('checked');
        $('.data3-checkbox:checkbox').removeAttr('checked');
        $('.page').hide();
    })

    //弹出练车时间的信息框
    function clicklcsj(e) {
        $('#modal-overlay').css('visibility', 'visible')
        $('.modal-data3').css('visibility', 'visible')
        $('.data3-checkbox:checkbox').removeAttr('checked');
        $('.page').show();
        _this = e;
    }

    //弹出模式框学生信息
    function clickName(e) {
        $('#modal-overlay').css('visibility', 'visible')
        $('.modal-data').css('visibility', 'visible')
        $('.data-checkbox:checkbox').removeAttr('checked');
        _this = e.parent().parent();
        myname = $('.name1').val();
        cflcsjid = $('.cflcsjid').val();
        index = 1
        $('#studebntList').html("<div class='loading'></div>");
        $.ajax({
            url: '<%=path2%>/DrivingSys/getPageDropexercise',
            type: "post",
            data: {
                'pindex': '0',
                'name': myname,
                'cflcsjid': cflcsjid
            },
            dataType: "json",
            success: function (res) {
                $('#studebntList').html(myTemplate(res));
                $('#totalPage').val(res.pb);
            },
            error: function () {
                alert('Error');
            }
        });
    }

    //把选中教练组名称和编码回填
    $('#subtn2').click(function () {
        var spCodesTemp = "";
        $('.coacegroup input:checkbox[name=coachesfid]:checked').each(function (i) {
            spCodesTemp = $(this).val();
        });

        $.ajax({
            url: '<%=path%>/DrivingSys/selectCoaceGroupByFidAsPage',
            type: "post",
            data: {'id': spCodesTemp},
            dataType: "json",
            success: function (res) {
                _this.children().children('input[name=jlznamebm]').val(res[0].fnumber);
                _this.children().children('input[name=jlzname]').val(res[0].fnameL2);
                //存入教练组id
                _this.children().children('input[name=cfjlgroupid]').val(res[0].fid);
                $('#modal-overlay').css('visibility', 'hidden')
                $('.modal-data2').css('visibility', 'hidden')
            },
            error: function () {
                alert('Error');
            }
        });

    });

    //把选中的教练信息名称填充到输入框中
    $('#subtn1').click(function () {
        var spCodesTemp = "";
        $('input:checkbox[name=personfid]:checked').each(function (i) {
            spCodesTemp = $(this).val();
        });

        $.ajax({
            url: '<%=path%>/DrivingSys/selectPersonByFidAsPage',
            type: "post",
            data: {'id': spCodesTemp},
            dataType: "json",
            success: function (res) {
                _this.children().children('input[name=jlznamebm]').val(res[0].fnumber);
                _this.children().children('input[name=jlzname]').val(res[0].jlzname);
                _this.children().children('input[name=cfcoachid]').val(res[0].fid);
                /*if (res[0].cfisvip == 0)
                 _this.children().children('input[name=cfduizhang]')*/
                _this.children().children('input[name=cfcoachName]').val(res[0].cfcoachName);
                _this.children().children('input[name=cfcoachphone]').val(res[0].cfphone);
                _this.children().children('input[name=cfcarcx]').val(res[0].cfcarcx);
                _this.children().children('input[name=cfcarnumber]').val(res[0].cfcarnumber);
                _this.children().children('input[name=cfjlgroupid]').val(res[0].cfcoachid);//教练组id

                if (res[0].jlznamebm == null || res[0].jlzname == null) {
                    alert("没有找到" + res[0].cfcoachName + "的组!");
                }

                $('#modal-overlay').css('visibility', 'hidden')
                $('.modal-data1').css('visibility', 'hidden')
            },
            error: function () {
                alert('Error');
            }
        });

    });

    //把选中的学生信息名称填充到输入框中
    $('.subtn').click(function () {
        var spCodesTemp = "";
        $('input:checkbox[name=student]:checked').each(function (i) {
            spCodesTemp = $(this).val();
        });

        var eachcount = 0;
        if (spCodesTemp == "") {
            alert('请选择学生信息！');
            return false;
        }
        $.ajax({
            url: '<%=path%>/DrivingSys/selStudentsBySharecartwo',
            type: "post",
            data: {
                'id': spCodesTemp,
                'state': '3'
            },
            dataType: "json",
            success: function (res) {

                res = res[0];

                $('.cfstudentid').each(function () {


                    if ($(this).val() == res.fid) {
                        alert('学员' + res.xyname + '信息重复！');
                        return false;
                    }

                    eachcount++

                    if (eachcount >= $(".cfstudentid").length) {
                        addData(res)
                    }

                })


            },
            error: function () {
                alert('Error');
            }
        });

    });

    function addData(res) {
        _this.children().children('input[name=cfstudentName]').val(res.xyname);
        _this.children().children('input[name=cfstudentid]').val(res.fid);
        _this.children().children('input[name=cfstudentno]').val(res.cfstudentno);
        _this.children().children('input[name=cfidcardno]').val(res.cfidcardno);
        _this.children().children('input[name=cfmobile]').val(res.cfmobile);
        _this.children().children('input[name=cfphone]').val(res.cfphone);
        _this.children().children('input[name=cfcoachName]').val(res.jlname);
        _this.children().children('input[name=cfcoachid]').val(res.cfcoachid);
        $('#modal-overlay').css('visibility', 'hidden')
        $('.modal-data').css('visibility', 'hidden')
    }

    $(document).on('keyup', '.cfcarpeoplenum', function (event) {
        //最后一位是小数点的话，移除
        var $amountInput = $(this);
        //响应鼠标事件，允许左右方向键移动
        event = window.event || event;
        if (event.keyCode == 37 | event.keyCode == 39) {
            return;
        }
        var clazz = $(this).prop("class")
        //获取输入框的值
        var value = $(this).val();
        //判断负数是否在第一位
        if (value.substring(0, 1) == '-') {

        }
        if (value.length == 0) {
            $(this).val("0")
        }
        if (value.lastIndexOf('0') == 0) {
            $(this).val(value.substring(1, value.length))
            // $amountInput.val($amountInput.val().replace('-','')
        }
        //判断负数不是在第一位，替换
        if (value.lastIndexOf('-') >= 0) {
            $(this).val("0")
            // $amountInput.val($amountInput.val().replace('-','')
        }
        //先把非数字的都替换掉，除了数字和.
        $amountInput.val($amountInput.val().replace(/[^\-?\d]/g, "").//只允许一个小数点
        replace(/^\./g, "").replace(/\.{2,}/g, ".").//只能输入小数点后两位
        replace(".", "$#$").replace(/\./g, "").replace("$#$", ".").replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3'));
        if ($(this).val() == "") {
            $(this).val(0)
        }
    });

    $(document).on('keyup', '.cflcts', function (event) {
        //最后一位是小数点的话，移除
        var $amountInput = $(this);
        //响应鼠标事件，允许左右方向键移动
        event = window.event || event;
        if (event.keyCode == 37 | event.keyCode == 39) {
            return;
        }
        var clazz = $(this).prop("class")
        //获取输入框的值
        var value = $(this).val();
        //判断负数是否在第一位
        if (value.substring(0, 1) == '-') {

        }
        if (value.length == 0) {
            $(this).val("0")
        }
        if (value.lastIndexOf('0') == 0) {
            $(this).val(value.substring(1, value.length))
            // $amountInput.val($amountInput.val().replace('-','')
        }
        //判断负数不是在第一位，替换
        if (value.lastIndexOf('-') >= 0) {
            $(this).val("0")
            // $amountInput.val($amountInput.val().replace('-','')
        }
        //先把非数字的都替换掉，除了数字和.
        $amountInput.val($amountInput.val().replace(/[^\-?\d]/g, "").//只允许一个小数点
        replace(/^\./g, "").replace(/\.{2,}/g, ".").//只能输入小数点后两位
        replace(".", "$#$").replace(/\./g, "").replace("$#$", ".").replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3'));
        if ($(this).val() == "") {
            $(this).val(0)
        }
    });

    //返回
    function back() {
        parent.closeSelectCard()
        //location = '<%=path%>/DrivingSys/queryDropexercisethree/look.action?state=first';
    }

</script>
<%@ include file="/WEB-INF/JSP/ajax.jsp" %>
</html>